//
//  NXTwelfthStepViewController.m
//  BiologyLibrary
//
//  Created by milo on 16/7/6.
//  Copyright © 2016年 youxh. All rights reserved.
//

#import "NXTwelfthStepViewController.h"
#import "NXThirteenthViewController.h"
@interface NXTwelfthStepViewController ()

@end

@implementation NXTwelfthStepViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _currentStep = self.NewRecordArray.firstObject.savedStepCount + 1;
    _keyStepStr = [NSString stringWithFormat:@"step%ld", _currentStep];
    
    [self setNaviBarTitle:self.NewRecordArray.firstObject.name];
    
    _questionMArray = [[NSMutableArray alloc] init];
    [self initData];
    
    _maintableview=[[UITableView alloc]initWithFrame:CGRectMake(10, 64, fWidth_Current-20, fHeight_Current-64-50)];
    _maintableview.backgroundColor = [UIColor clearColor];
    _maintableview.separatorStyle = UITableViewCellSeparatorStyleNone;
    _maintableview.dataSource = self;
    _maintableview.delegate = self;
    _maintableview.showsVerticalScrollIndicator=NO;
    [self.view addSubview:_maintableview];
    
    UIImageView*buttomview=[[UIImageView alloc]initWithFrame:CGRectMake(0, fHeight_Current-50, fWidth_Current, 50)];
    buttomview.backgroundColor=[UIColor colorWithRed:0.16 green:0.19 blue:0.24 alpha:1.0];
    [self.view addSubview:buttomview];
    UILabel *label=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, fWidth_Current, 50)];
    label.backgroundColor=[UIColor clearColor];
    label.textAlignment=1;
    label.font=[UIFont systemFontOfSize:14];
    label.textColor=[UIColor lightGrayColor];
    label.text= [NSString stringWithFormat:@"当下是第%ld/%ld步",
                 (long)self.NewRecordArray.firstObject.savedStepCount + 1, (long)self.NewRecordArray.firstObject.allStepCount];
    [buttomview addSubview:label];
    selectArr = [[NSMutableArray alloc]initWithObjects:@"√",@"○",@"X", nil];
    pickerview = [[ZJPickerview alloc] initWithTitle:@"选择" KeyName:nil];
    pickerview.zjDelegate = self;
}

-(void)initData
{
    for (Record *oneRecord in self.NewRecordArray) {
        NSMutableArray*onequestArr=[[NSMutableArray alloc]init];
        if([[oneRecord getDetailDict] objectForKey:_keyStepStr])
        {
            NSArray *tempArray = (NSArray *)[[oneRecord getDetailDict] objectForKey:_keyStepStr];
            for (NSDictionary *tempDict in tempArray)
            {
                NSString *tiji = @"1000（默认）";
                if([@"囊液细胞" isEqualToString:[tempDict objectForKey:@"name"]])
                {
                    tiji = @"";
                }
                NSMutableDictionary *questionMDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                                      [tempDict objectForKey:@"name"], @"name",
                                                      tiji, @"tiji",
                                                      [self nowtype2:[tempDict objectForKey:KEY_RECORD_ANSWER]], KEY_RECORD_ANSWER, nil];
                [onequestArr addObject:questionMDict];
            }
        }
        else
        {
            for (int i = 0; i < 6; i ++)
            {
                NSString *name = @"囊液上清";
                NSString *tiji = @"1000（默认）";
                if (i > 2)
                {
                    name = @"囊液细胞";
                    tiji = @"";
                }
                NSMutableDictionary *questionMDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                                      name, @"name",
                                                      tiji, @"tiji",
                                                      @"√", KEY_RECORD_ANSWER, nil];
                [onequestArr addObject:questionMDict];
                
            }
        }
        [_questionMArray addObject:onequestArr];
    }
    
}

#pragma mark - UITableViewDataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2+self.NewRecordArray.count;//返回标题数组中元素的个数来确定分区的个数
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.section==0) {
        NSString*titlestr=@"12、将上清液转移至编号对应的黄盖冻存管中，达到SOP要求的直接在空格内打“√ ”，如果体积未达到要求的，可以选择“○”，体积不足未分装则在空格内打“X”。";
        
        CGSize hight=[TGCDataCenter getContentSize:titlestr WithMaxSize:CGSizeMake(fWidth_Current-40, 1000) Font:[UIFont systemFontOfSize:17] LineBreakMode:NSLineBreakByWordWrapping];
        
        return 40+hight.height;
        
    }else if(indexPath.section==1+self.NewRecordArray.count){
        return 50;
    }else{
        NSArray*onequestionArr=[_questionMArray objectAtIndex:indexPath.section-1];
        return ([onequestionArr count] + 1) * 40+35;
    }
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 10;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView*headview=[[UIView alloc]initWithFrame:CGRectMake(0, 0, fWidth_Current, 18)];
    headview.backgroundColor=[UIColor clearColor];
    return headview;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *strIdentifier = [NSString stringWithFormat:@"strIdentifier%zd%zd",indexPath.section,indexPath.row];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:strIdentifier];
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
                                  reuseIdentifier:strIdentifier];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.backgroundColor=[UIColor colorWithRed:0.16 green:0.19 blue:0.24 alpha:1.0];
    if (indexPath.section==0) {
        NSString*titlestr=@"12、将上清液转移至编号对应的黄盖冻存管中，达到SOP要求的直接在空格内打“√ ”，如果体积未达到要求的，可以选择“○”，体积不足未分装则在空格内打“X”。";
        
        CGSize hight=[TGCDataCenter getContentSize:titlestr WithMaxSize:CGSizeMake(fWidth_Current-40, 1000) Font:[UIFont systemFontOfSize:17] LineBreakMode:NSLineBreakByWordWrapping];
        
        UILabel *titlelab=[[UILabel alloc]initWithFrame:CGRectMake(10, 20, fWidth_Current-40, hight.height)];
        titlelab.textColor=[UIColor whiteColor];
        titlelab.backgroundColor=[UIColor clearColor];
        titlelab.text=titlestr;
        titlelab.numberOfLines=0;
        UIImageView*lineview=[[UIImageView alloc]initWithFrame:CGRectMake(0,hight.height+40, fWidth_Current-20, 0.5)];
        lineview.backgroundColor=[UIColor colorWithRed:0.91 green:0.91 blue:0.91 alpha:0.3];
        [cell addSubview:titlelab];
        [cell addSubview:lineview];
        
    }else if (indexPath.section==1+self.NewRecordArray.count) {
        cell.backgroundColor=[UIColor clearColor];
        
        if (self.fromtype && [self.fromtype isEqualToString:@"search"]) {
            
            UIButton *btn2=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 50)];
            btn2.backgroundColor=[UIColor colorWithRed:0.22 green:0.57 blue:0.91 alpha:1.0];
            btn2.layer.cornerRadius=5;
            [btn2 setTitle:@"下一步" forState:UIControlStateNormal];
            btn2.clipsToBounds=YES;
            [btn2 addTarget:self action:@selector(nextStepClick) forControlEvents:UIControlEventTouchUpInside];
            [cell addSubview:btn2];
        }else{
            
            UIButton *btn1=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, (fWidth_Current-30)/2, 50)];
            btn1.backgroundColor=[UIColor colorWithRed:0.16 green:0.19 blue:0.24 alpha:1.0];
            btn1.layer.cornerRadius=5;
            [btn1 setTitle:@"取消" forState:UIControlStateNormal];
            btn1.clipsToBounds=YES;
            [btn1 addTarget:self action:@selector(cancelclick) forControlEvents:UIControlEventTouchUpInside];
            [cell addSubview:btn1];
            UIButton *btn2=[[UIButton alloc]initWithFrame:CGRectMake((fWidth_Current-30)/2+10, 0, (fWidth_Current-30)/2, 50)];
            btn2.backgroundColor=[UIColor colorWithRed:0.22 green:0.57 blue:0.91 alpha:1.0];
            btn2.layer.cornerRadius=5;
            [btn2 setTitle:@"保存" forState:UIControlStateNormal];
            btn2.clipsToBounds=YES;
            [btn2 addTarget:self action:@selector(saveClick) forControlEvents:UIControlEventTouchUpInside];
            [cell addSubview:btn2];
        }
    }else{
        NSArray *onequestionArr=[_questionMArray objectAtIndex:indexPath.section-1];
        for (int i=0; i<=[onequestionArr count]; i++) {
            Record*nowrecord=[self.NewRecordArray objectAtIndex:indexPath.section-1];
            UILabel*recordNameLab=[[UILabel alloc]initWithFrame:CGRectMake(10, 5, fWidth_Current, 30)];
            recordNameLab.backgroundColor=[UIColor clearColor];
            recordNameLab.textColor=[UIColor whiteColor];
            recordNameLab.font=[UIFont systemFontOfSize:16];
            recordNameLab.text=[NSString stringWithFormat:@"样本号：%@",nowrecord.recordId];
            [cell addSubview:recordNameLab];
            
            
            UILabel*titlelab=[[UILabel alloc]initWithFrame:CGRectMake(0,35+i*40 , 70, 40)];
            titlelab.textColor=[UIColor lightGrayColor];
            titlelab.font=[UIFont systemFontOfSize:16];
            titlelab.backgroundColor=[UIColor clearColor];
            titlelab.textAlignment=1;
            [cell addSubview:titlelab];
            UIImageView*lineview=[[UIImageView alloc]initWithFrame:CGRectMake(0, 35+40+i*40, fWidth_Current-20, 0.5)];
            lineview.backgroundColor=[UIColor colorWithRed:0.91 green:0.91 blue:0.91 alpha:0.3];
            [cell addSubview:lineview];
            
            UILabel*titlelab2=[[UILabel alloc]initWithFrame:CGRectMake(70,35+i*40 , (fWidth_Current-20-70 -30)/2, 40)];
            titlelab2.textColor=[UIColor lightGrayColor];
            titlelab2.font=[UIFont systemFontOfSize:16];
            titlelab2.textAlignment=1;
            titlelab2.backgroundColor=[UIColor clearColor];
            [cell addSubview:titlelab2];
            UILabel*titlelab3=[[UILabel alloc]initWithFrame:CGRectMake(70+(fWidth_Current-20-70 - 30)/2,35+i*40 , (fWidth_Current-20-70 - 30)/2, 40)];
            titlelab3.tag = g_iTag_Label + i - 1;
            titlelab3.textColor=[UIColor lightGrayColor];
            titlelab3.font=[UIFont systemFontOfSize:16];
            titlelab3.textAlignment=1;
            titlelab3.backgroundColor=[UIColor clearColor];
            [cell addSubview:titlelab3];
            
            UIImageView *sanjiaoview=[[UIImageView alloc]initWithFrame:CGRectMake(70+(fWidth_Current-20-70 - 30) - 30,35+i*40 + 12, 13, 13)];
            sanjiaoview.backgroundColor=[UIColor clearColor];
            sanjiaoview.image=[UIImage imageNamed:@"sanjiaoimg"];
            [cell addSubview:sanjiaoview];
            
            MiloBtn*btn=[[MiloBtn alloc]initWithFrame:CGRectMake(70+(fWidth_Current-20-70 - 30)/2,35+i*40 , (fWidth_Current-20-70 - 30)/2, 40)];
            btn.tag = g_iTag_Button + i - 1;
            btn.subtag = indexPath.section-1;
            btn.backgroundColor=[UIColor clearColor];
            [cell addSubview:btn];
            
            MiloBtn *operatButton = [[MiloBtn alloc]initWithFrame:
                                     CGRectMake(titlelab3.frame.origin.x + titlelab3.frame.size.width,
                                                titlelab3.frame.origin.y + 7.5, 30,
                                                titlelab3.frame.size.height - 15)];
            operatButton.tag = g_iTag_TextField + i;
            operatButton.subtag = indexPath.section-1;
            operatButton.backgroundColor = [UIColor colorWithRed:0.22 green:0.57 blue:0.91 alpha:1.0];
            operatButton.layer.cornerRadius = 10;
            operatButton.titleLabel.font = [UIFont systemFontOfSize:11];
            operatButton.clipsToBounds=YES;
            [cell addSubview:operatButton];
            
            if (self.fromtype && [self.fromtype isEqualToString:@"search"]) {
                sanjiaoview.hidden = YES;
                operatButton.hidden = YES;
            }else{
                sanjiaoview.hidden = NO;
                operatButton.hidden = NO;
            }
            
            if (i==0) {
                titlelab.text=@"类别";
                titlelab2.text=@"体积（uL）";
                titlelab3.text=@"状态";
                sanjiaoview.hidden=YES;
                btn.hidden=YES;
                
                [operatButton setTitle:@"添加" forState:UIControlStateNormal];
                [operatButton addTarget:self action:@selector(addClick:) forControlEvents:UIControlEventTouchUpInside];
            }
            else
            {
                NSMutableDictionary *tempMDict = (NSMutableDictionary *)[onequestionArr objectAtIndex:i - 1];
                
                titlelab.text = [tempMDict objectForKey:@"name"];
                titlelab2.text = [tempMDict objectForKey:@"tiji"];
                titlelab3.text = [tempMDict objectForKey:KEY_RECORD_ANSWER];
                titlelab3.textColor = [UIColor colorWithRed:0.22 green:0.57 blue:0.91 alpha:1.0];
                
                [operatButton setTitle:@"删除" forState:UIControlStateNormal];
                [operatButton addTarget:self action:@selector(deleteClick:) forControlEvents:UIControlEventTouchUpInside];
                
                if (self.fromtype && [self.fromtype isEqualToString:@"search"])
                {
                    [btn removeTarget:self action:@selector(slelectclick:) forControlEvents:UIControlEventTouchUpInside];
                }
                else
                {
                    [btn addTarget:self action:@selector(slelectclick:) forControlEvents:UIControlEventTouchUpInside];
                }
            }
        }
        
        UIImageView*lineview3=[[UIImageView alloc]initWithFrame:CGRectMake(70, 35, 0.5, ([onequestionArr count] + 1) * 40)];
        lineview3.backgroundColor=[UIColor colorWithRed:0.91 green:0.91 blue:0.91 alpha:0.3];
        UIImageView*lineview2=[[UIImageView alloc]initWithFrame:CGRectMake(70+(fWidth_Current-20-70 -30)/2, 35, 0.5, ([onequestionArr count] + 1) * 40)];
        lineview2.backgroundColor=[UIColor colorWithRed:0.91 green:0.91 blue:0.91 alpha:0.3];
        [cell addSubview:lineview3];
        [cell addSubview:lineview2];
    }
    
    return cell;
}
-(void)slelectclick:(MiloBtn *)sender
{
    _iSelectedIndex = sender.tag - g_iTag_Button;
    nowIndex = sender.subtag;
    NSArray*onequestArr=[_questionMArray objectAtIndex:nowIndex];
    NSMutableDictionary *tempMDict = (NSMutableDictionary *)[onequestArr objectAtIndex:_iSelectedIndex];
    
    if (pickerview.isShowed == NO)
    {
        [pickerview showInView:self.view
                     withArray:selectArr
                 selectedIndex:(int)[selectArr indexOfObject:[tempMDict objectForKey:KEY_RECORD_ANSWER]]];
    }
}
#pragma mark - ZJPickerviewDelegate
-(void)ZJPickerview:(ZJPickerview *)zjPickerview didFineshesAtIndex:(int)index
{
    NSMutableArray*onequestArr=[_questionMArray objectAtIndex:nowIndex];
    NSMutableDictionary *tempMDict = (NSMutableDictionary *)[onequestArr objectAtIndex:_iSelectedIndex];
    
    [tempMDict setObject:[NSString stringWithFormat:@"%@",[selectArr objectAtIndex:index]] forKey:KEY_RECORD_ANSWER];
    [onequestArr replaceObjectAtIndex:_iSelectedIndex withObject:tempMDict];
    [_questionMArray replaceObjectAtIndex:nowIndex withObject:onequestArr];
    [_maintableview reloadData];
}

-(void)addClick:(MiloBtn *)sender
{

    nowIndex=sender.subtag;
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示"
                                                    message:@"选择添加类别"
                                                   delegate:self
                                          cancelButtonTitle:@"取消"
                                          otherButtonTitles:@"囊液上清", @"囊液细胞",nil];
    [alert show];
}

#pragma mark UIAlertViewDelegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if (buttonIndex == 1)
    {
   
        NSMutableArray*onequestArr=[_questionMArray objectAtIndex:nowIndex];
        NSMutableDictionary *questionMDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                              @"囊液上清", @"name",
                                              @"1000（默认）", @"tiji",
                                              @"√", KEY_RECORD_ANSWER, nil];
        if (onequestArr.count<=1) {
            [onequestArr addObject:questionMDict];
            //如果只有1个样本 那么直接加在最后
        }else{
            NSDictionary*dic=[onequestArr firstObject];
            NSString*name=[dic objectForKey:@"name"];
            if (![name isEqualToString:@"囊液上清"]) {
                [onequestArr addObject:questionMDict];
                //如果第一个样本不是血浆  那么血浆肯定在最后或者没有血浆存在 直接加一个血浆在最后
            }else{
                NSDictionary*dicl=[onequestArr lastObject];
                NSString*namel=[dicl objectForKey:@"name"];
                if ([namel isEqualToString:@"囊液上清"]) {
                    [onequestArr addObject:questionMDict];
                    //如果第一个是血浆 而且最后一个也是血浆 那么也直接在最后加
                }else{
                    for (int i=0;i<onequestArr.count;i++) {
                        NSDictionary*dic1=[onequestArr objectAtIndex:i];
                        NSString*name1=[dic1 objectForKey:@"name"];
                        if (![name1 isEqualToString:@"囊液上清"]) {
                            [onequestArr insertObject:questionMDict atIndex:i];
                            break;
                        }
                    }
                }
            }
            
        }
        [_questionMArray replaceObjectAtIndex:nowIndex withObject:onequestArr];
        [_maintableview reloadData];
    }
    else if(buttonIndex == 2)
    {
        
        NSMutableArray*onequestArr=[_questionMArray objectAtIndex:nowIndex];
        NSMutableDictionary *questionMDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                              @"囊液细胞", @"name",
                                              @"", @"tiji",
                                              @"√", KEY_RECORD_ANSWER, nil];
        if (onequestArr.count<=1) {
            [onequestArr addObject:questionMDict];
            //如果只有1个样本 那么直接加在最后
        }else{
            NSDictionary*dic=[onequestArr firstObject];
            NSString*name=[dic objectForKey:@"name"];
            if (![name isEqualToString:@"囊液细胞"]) {
                [onequestArr addObject:questionMDict];
                //如果第一个样本不是血浆  那么血浆肯定在最后或者没有血浆存在 直接加一个血浆在最后
            }else{
                NSDictionary*dicl=[onequestArr lastObject];
                NSString*namel=[dicl objectForKey:@"name"];
                if ([namel isEqualToString:@"囊液细胞"]) {
                    [onequestArr addObject:questionMDict];
                    //如果第一个是血浆 而且最后一个也是血浆 那么也直接在最后加
                }else{
                    for (int i=0;i<onequestArr.count;i++) {
                        NSDictionary*dic1=[onequestArr objectAtIndex:i];
                        NSString*name1=[dic1 objectForKey:@"name"];
                        if (![name1 isEqualToString:@"囊液细胞"]) {
                            [onequestArr insertObject:questionMDict atIndex:i];
                            break;
                        }
                    }
                }
            }
            
        }
        [_questionMArray replaceObjectAtIndex:nowIndex withObject:onequestArr];
        [_maintableview reloadData];
    }
}

-(void)deleteClick:(MiloBtn *)sender
{
    NSMutableArray*onequestArr=[_questionMArray objectAtIndex:sender.subtag];
    
    [onequestArr removeObjectAtIndex:sender.tag - g_iTag_TextField - 1];
    [_questionMArray replaceObjectAtIndex:sender.subtag withObject:onequestArr];
    
    [_maintableview reloadData];
}

-(void)saveClick{
    [self creatDetailDict];
   
    NXThirteenthViewController *NXThirteenthStepVC = [[NXThirteenthViewController alloc] init];
    NXThirteenthStepVC.NewRecordArray = self.NewRecordArray;
    NXThirteenthStepVC.shiguanarr = _questionMArray;
    [self.navigationController pushViewController:NXThirteenthStepVC animated:YES];
}
-(void)creatDetailDict
{
    for (Record *oneRecord in self.NewRecordArray) {
        NSInteger index =[self.NewRecordArray indexOfObject:oneRecord];
        NSArray*oneQuestionArr=[_questionMArray objectAtIndex:index];
        NSMutableArray *qustionMArray = [[NSMutableArray alloc] init];
        for (NSMutableDictionary *tempMDict in oneQuestionArr)
        {
            NSDictionary *questionDict = [NSDictionary dictionaryWithObjectsAndKeys:
                                          @"1", KEY_RECORD_QUESTION,
                                          TYPE_QUESTION_DEFAULT, KEY_RECORD_TYPE,
                                          [tempMDict objectForKey:@"name"], @"name",
                                          [self nowtype:[tempMDict objectForKey:KEY_RECORD_ANSWER]], KEY_RECORD_ANSWER, nil];
            [qustionMArray addObject:questionDict];
        }
        NSMutableDictionary *tempDict = [oneRecord getDetailDict];
        [tempDict setObject:qustionMArray forKey:_keyStepStr];
        [oneRecord setDetailDict:tempDict];
        oneRecord.recordDetail = [tempDict JSONString];
        oneRecord.savedStepCount = _currentStep;
        dispatch_async(dispatch_get_global_queue(0, 0), ^{
            [oneRecord update];
        });
    }
}

-(NSString*)nowtype:(NSString*)gou{
    if ([gou isEqualToString:@"√"]) {
        return @"1";
    }else if([gou isEqualToString:@"○"]){
        return @"2";
    }else{
        return @"0";
    }
}
-(NSString*)nowtype2:(NSString*)str{
    if ([str isEqualToString:@"1"]) {
        return @"√";
    }else if([str isEqualToString:@"2"]){
        return @"○";
    }else{
        return @"X";
    }
}
-(void)cancelclick{
    UIViewController*miloViewControl=(UIViewController *)[[self.navigationController viewControllers]objectAtIndex:1];
    [self.navigationController popToViewController:miloViewControl animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)nextStepClick{
    
    self.NewRecordArray.firstObject.savedStepCount = _currentStep;

    NXThirteenthViewController *NXThirteenthStepVC = [[NXThirteenthViewController alloc] init];
    NXThirteenthStepVC.NewRecordArray = self.NewRecordArray;
    NXThirteenthStepVC.shiguanarr = _questionMArray;
    NXThirteenthStepVC.fromtype = @"search";
    [self.navigationController pushViewController:NXThirteenthStepVC animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
